<?php

namespace Nim\Bundle\ModelBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;

/**
 * ClientOrder
 *
 * @ORM\Table(name="client_order")
 * @ORM\Entity
 */
class ClientOrder
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="state", type="string", length=10)
     */
    private $state;
    
    /**
     * @ORM\OneToOne(targetEntity="Reseller")
     * @ORM\JoinColumn(name="reseller_id", referencedColumnName="id")
     **/
    private $reseller;
    
    /**
     * @ORM\OneToMany(targetEntity="ClientOrderItem", mappedBy="clientOrder")
     */
    private $clientOrderItems;
    
    /**
     * @ORM\ManyToOne(targetEntity="Campain", inversedBy="clientOrders")
     * @ORM\JoinColumn(name="campain_id")
     */
    private $campain;
    
    /**
     * @ORM\ManyToOne(targetEntity="Client", inversedBy="clientOrders")
     * @ORM\JoinColumn(name="client_id")
     */
    private $client;
    
    public function __construct()
    {
    	$this->clientOrderItems = new ArrayCollection();
    }


    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set state
     *
     * @param string $state
     * @return ClientOrder
     */
    public function setState($state)
    {
        $this->state = $state;
    
        return $this;
    }

    /**
     * Get state
     *
     * @return string 
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * Set reseller
     *
     * @param \Nim\Bundle\ModelBundle\Entity\Reseller $reseller
     * @return ClientOrder
     */
    public function setReseller(\Nim\Bundle\ModelBundle\Entity\Reseller $reseller = null)
    {
        $this->reseller = $reseller;
    
        return $this;
    }

    /**
     * Get reseller
     *
     * @return \Nim\Bundle\ModelBundle\Entity\Reseller 
     */
    public function getReseller()
    {
        return $this->reseller;
    }

    /**
     * Add clientOrderItems
     *
     * @param \Nim\Bundle\ModelBundle\Entity\ClientOrderItem $clientOrderItems
     * @return ClientOrder
     */
    public function addClientOrderItem(\Nim\Bundle\ModelBundle\Entity\ClientOrderItem $clientOrderItems)
    {
        $this->clientOrderItems[] = $clientOrderItems;
    
        return $this;
    }

    /**
     * Remove clientOrderItems
     *
     * @param \Nim\Bundle\ModelBundle\Entity\ClientOrderItem $clientOrderItems
     */
    public function removeClientOrderItem(\Nim\Bundle\ModelBundle\Entity\ClientOrderItem $clientOrderItems)
    {
        $this->clientOrderItems->removeElement($clientOrderItems);
    }

    /**
     * Get clientOrderItems
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getClientOrderItems()
    {
        return $this->clientOrderItems;
    }

    /**
     * Set campain
     *
     * @param \Nim\Bundle\ModelBundle\Entity\Campain $campain
     * @return ClientOrder
     */
    public function setCampain(\Nim\Bundle\ModelBundle\Entity\Campain $campain = null)
    {
        $this->campain = $campain;
    
        return $this;
    }

    /**
     * Get campain
     *
     * @return \Nim\Bundle\ModelBundle\Entity\Campain 
     */
    public function getCampain()
    {
        return $this->campain;
    }

    /**
     * Set client
     *
     * @param \Nim\Bundle\ModelBundle\Entity\Client $client
     * @return ClientOrder
     */
    public function setClient(\Nim\Bundle\ModelBundle\Entity\Client $client = null)
    {
        $this->client = $client;
    
        return $this;
    }

    /**
     * Get client
     *
     * @return \Nim\Bundle\ModelBundle\Entity\Client 
     */
    public function getClient()
    {
        return $this->client;
    }
}